--[[/**
-- * 
 * 抽取血量
-- *
-- */]]

---@class BuffEffect248100 : BaseBuffEffect
BuffEffect248100 = ClientFight.CreateClass("BuffEffect248100", ClientFight.BaseBuffEffect)
local t = BuffEffect248100
t.BUFF_EFFECT_248100_ADDHP = "BUFF_EFFECT_248100_ADDHP";
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local target = buff.target;

    local ratio = buff.buffBean.f_BuffEffectValue[1];
    local reduceHp = (FighterAttributeManager.getFightAttr(target, FighterAttributeEnum.HP) * toRatio(ratio));
    if (target.hp <= reduceHp) then
        reduceHp = target.hp - 1;
    end
    local skill = buff.skill;
    local realDamage = DamageManager.setFighterHp(fight,target,buff.source,nil, DamageResultTypeEnum.NORMAL,-reduceHp
    ,target.hp - reduceHp,true,true,true);
    skill.parentSkill.parameters[t.BUFF_EFFECT_248100_ADDHP] = realDamage;

    local logReduceHp = reduceHp;
    SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
            .. buff.modelId .. " 抽取对方血量 : ".. logReduceHp);
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()